//
//  TGJLCell.m
//  NewPro
//
//  Created by RYX on 2019/4/24.
//  Copyright © 2019 何荧红. All rights reserved.
//

#import "TGJLCell.h"
#import "IncomeListModel.h"

@implementation TGJLCell

+ (instancetype)tempWithTableView:(UITableView *)tableView{
    
    TGJLCell *cell = [tableView dequeueReusableCellWithIdentifier:@"CELL"];
    if (!cell) {
        
        ClassName
        cell = [[[NSBundle mainBundle] loadNibNamed:className owner:self options:nil] objectAtIndex:0];
    }
    
    return cell;
}

- (void)setModel:(IncomeListModel *)model{
    
    self.amountLa.text = [NSString stringWithFormat:@"%@",model.amount];
    self.merchantNoLa.text = model.merchantNo;
    self.dateLa.text = model.transDate;
    
    CGFloat a = [model.income floatValue];
    if (a >= 0) {
        
        self.incomeLa.text = [NSString stringWithFormat:@"+%@",model.income];
    }else{
        
        self.incomeLa.text = [NSString stringWithFormat:@"%@",model.income];
    }
    
    if ([model.operationType isEqualToString:@"1"]) {
        
        self.typeLa.text = @"冲正";
        self.typeLa.backgroundColor = UIColor.redColor;
    }else if ([model.operationType isEqualToString:@"2"]) {
        
        self.typeLa.text = @"撤销";
        self.typeLa.backgroundColor = UIColor.redColor;
    }else{
        
        self.typeLa.text = model.tradeType;
        self.typeLa.backgroundColor = BLUECOLOR;
    }
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
